import requests

# 图片url
url = "https://www.baidu.com/img/bd_logo1.png"
# 响应是一个图片，本身是二进制类型
response = requests.get(url)
# 以二进制的方式写入到文件当中
with open("resources/images/baidu.png", "wb") as f:
    # 文件写入二进制数据
    f.write(response.content)

print("图片下载完成")